home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / PIBSIGS / TESTSIGT.PAS < prev    next >
Pascal/Delphi Source File  |  1986-06-22  |  2KB  |  59 lines

  1. (*--------------------------------------------------------------------------*)
  2. (*                 TestSigt --- Test t significance routine                 *)
  3. (*--------------------------------------------------------------------------*)
  4.  
  5. PROGRAM TestSigt;
  6.  
  7. (*--------------------------------------------------------------------------*)
  8. (*                                                                          *)
  9. (*   Program:  TestSigt                                                     *)
  10. (*                                                                          *)
  11. (*   Purpose:  Demonstrate t-significance routine in PIBSIGS.LBR            *)
  12. (*                                                                          *)
  13. (*   Usage:    This program prompts for a t-value and corresponding         *)
  14. (*             degrees of freedom.  It computes and prints both a           *)
  15. (*             one-tailed and a two-tailed significance level for           *)
  16. (*             the given t value.                                           *)
  17. (*                                                                          *)
  18. (*             To stop the program, enter a t value of -99.                 *)
  19. (*                                                                          *)
  20. (*   Calls:    Sigt                                                         *)
  21. (*                                                                          *)
  22. (*--------------------------------------------------------------------------*)
  23.  
  24. VAR
  25.    t:    REAL;
  26.    Df:   REAL;
  27.    P:    REAL;
  28.    Done: BOOLEAN;
  29.  
  30. (*$I SIGCONST.PAS *)
  31. (*$I POWTEN.PAS   *)
  32. (*$I LOGTEN.PAS   *)
  33. (*$I ALGAMA.PAS   *)
  34. (*$I CDBETA.PAS   *)
  35. (*$I SIGT.PAS     *)
  36.  
  37. BEGIN (* TestSigt *)
  38.  
  39.    Done := FALSE;
  40.    ClrScr;
  41.  
  42.    REPEAT
  43.  
  44.       WRITE('Enter t-value and degrees of freedom (-99 to stop): ');
  45.       READLN( t, Df );
  46.  
  47.       IF ( t > 0.0 ) THEN
  48.          BEGIN
  49.             P     := Sigt( t, Df );
  50.             WRITELN('Two-tailed significance = ',P:8:5);
  51.             WRITELN('One-tailed significance - ',( P / 2.0 ):8:5);
  52.          END
  53.       ELSE
  54.          Done := TRUE;
  55.  
  56.    UNTIL Done;
  57.  
  58.  
  59. END   (* TestSigt *).